package dswork.http;

public class HttpUtilDemo
{
	public static void main(String[] args)
	{
		{
			HttpUtil http = new HttpUtil();
			java.io.InputStream connectStream = http.create("https://igbe.zrwl-iot.com/v1/getRtuData?rtuNumber=100500")//
					.setRequestMethod("GET")//
					.addRequestProperty("From", "0")//
					.addRequestProperty("Accept-Language", "zh-cn")//
					.addRequestProperty("Token", "eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiIxMiIsImlhdCI6MTYwOTgyODc1OSwiZXhwIjoxNjA5ODM1OTU5fQ.5UqyWVYPyXiPrnvCWgSl8UF9lDLEw41ZuqM8ig0RATY")//
					.setContentType("application/x-www-form-urlencoded; charset=UTF-8")
					.connectStream("UTF-8");
			try
			{
				java.io.ByteArrayOutputStream outStream = new java.io.ByteArrayOutputStream();
				byte[] data = new byte[1024];
				int count = -1;
				while((count = connectStream.read(data, 0, 1024)) != -1)
				{
					outStream.write(data, 0, count);
				}
				data = null;
				byte[] byteArray = outStream.toByteArray();
				System.out.println(new String(byteArray, "UTF-8"));
			}
			catch(Exception e)
			{
			}
			finally
			{
				try
				{
					connectStream.close();
				}
				catch(Exception ee)
				{
				}
			}
		}
	}
}
